          
          
         
          //var originalWidth = consultWidth = window.innerWidth;
          //var linkJumpCount = 16;
          var linkHref;
          var beginningDelay = null;
          var animateDelayCount = 4000;
          var arr = [];
          var nameArr = [];
          var realm = 'http://hzs.52hzs.cn/hzs';
          //var watchBrowse = null;
          
            //内容高度是否小于屏幕高度
            function checkContnHeight(){
                if($('.container')[0].offsetHeight < window.innerHeight){
                    $('.container').addClass('fillAll');
                }
            }
            //前进后退页面处于顶部
            function beginningAtTop(){
                setTimeout(function(){
                    document.documentElement.scrollTop = document.body.scrollTop = 0;
                },10)
            }

            //判断是否为移动设备
            function browserRedirect(){
                var sUserAgent = navigator.userAgent.toLowerCase();
                var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
                var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
                var bIsMidp = sUserAgent.match(/midp/i) == "midp";
                var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
                var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
                var bIsAndroid = sUserAgent.match(/android/i) == "android";
                var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
                var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
                if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                    $('body').addClass('mobileDevice');
                    return true;
                }else{
                    return false;
                }
            }
            
            var urlCheck = null;
            $(document).ready(function(){
                    browserRedirect(); 
                    setTimeout(checkContnHeight,10);
                    var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                    if(window.innerWidth <= 1024){
                        if(scrollTop != 0 && $('header nav')[0].className.indexOf('addBg') < 0){
                            $('header nav').addClass('addBg');
                        }else if(scrollTop == 0 && $('header nav')[0].className.indexOf('addBg') >= 0){
                            $('header nav').removeClass('addBg');
                        }
                    }else{
                        var navH = $('header nav')[0].offsetHeight;
                        if(scrollTop >= window.innerHeight - navH && $('header nav')[0].className.indexOf('addBg') < 0){
                            $('header nav').addClass('addBg');
                        }else if(scrollTop < window.innerHeight - navH && $('header nav')[0].className.indexOf('addBg') >= 0){
                            $('header nav').removeClass('addBg');
                        }
                    }
                   
                    
                    $('header nav .menuBtn').click(function(){
                        if($(this)[0].className.indexOf('clicked') < 0){
                            $(this).addClass('clicked');
                            var innerH = $('header nav .mobileMenu .inner')[0].offsetHeight;
                            $('header nav .mobileMenu').height(innerH);
                        }else{
                            $(this).removeClass('clicked');
                            $('header nav .mobileMenu').height(0);
                        }
                    })

                    
                    urlCheck = setInterval(function(){
                        var urlNow = window.location.href;
                        if(urlNow.indexOf('#') >= 0){
                            if(urlNow.indexOf('named') >= 0 && $('header nav .links .active').text() != '公司起名'){
                                $('header nav .links a').removeClass('active');
                                $('header nav .mobileMenu ul li a').removeClass('active');
                                $('footer .contn nav .right a').removeClass('active');
                                $('header nav .links a').eq(0).addClass('active');
                                $('header nav .mobileMenu ul li a').eq(0).addClass('active');
                                $('footer .contn nav .right a').eq(0).addClass('active');
                                $('main .pageHead .content form .form-group:nth-child(3)').removeClass('hidden');
                                $('main .pageHead .content form .form-group:nth-child(2)').addClass('hidden');
                            }else if(urlNow.indexOf('check') >= 0 && $('header nav .links .active').text() != '公司核名'){
                                $('header nav .links a').removeClass('active');
                                $('header nav .mobileMenu ul li a').removeClass('active');
                                $('footer .contn nav .right a').removeClass('active');
                                $('header nav .links a').eq(1).addClass('active');
                                $('header nav .mobileMenu ul li a').eq(1).addClass('active');
                                $('footer .contn nav .right a').eq(1).addClass('active');
                                $('main .pageHead .content form .form-group:nth-child(3)').addClass('hidden');
                                $('main .pageHead .content form .form-group:nth-child(2)').removeClass('hidden');
                            }
                        }
                    },10)

                    $('main .pageHead .content form .form-group input').click(function(){
                        var id = $(this).attr('id');
                        if(!$(this).siblings('ul').length){
                            $('main .pageHead .content form .form-group ul').removeClass('show');
                            if(($(this)[0].className.indexOf('showList') >= 0 && $('main .pageHead .content .' + id)[0].className.indexOf('show') >= 0)){
                                $('main .pageHead .content .list').removeClass('show');
                                $('main .pageHead .content form .form-group input').removeClass('focus');
                                $('.area.list .provinces').removeClass('hidden');
                                $('.area.list .cities').addClass('hidden');
                                return false;
                            }
        
                            $('main .pageHead .content .list').removeClass('show');
                            $('main .pageHead .content form .form-group input').removeClass('focus');
                            $('.area.list .provinces').removeClass('hidden');
                            $('.area.list .cities').addClass('hidden');
                            if($(this)[0].className.indexOf('showList') >= 0 && $('main .pageHead .content .' + id)[0].className.indexOf('show') < 0){
                                $(this).addClass('focus');
                                $('main .pageHead .content .' + id).addClass('show');
                            }
                        }else{
                            if($(this).siblings('ul')[0].className.indexOf('show') >= 0){
                                $(this).siblings('ul').removeClass('show');
                                $(this).removeClass('focus');
                            }else{
                                $('main .pageHead .content form .form-group input').removeClass('focus');
                                $('main .pageHead .content .list').removeClass('show');
                                $('.area.list .provinces').removeClass('hidden');
                                $(this).addClass('focus');
                                $(this).siblings('ul').addClass('show');
                                $('.area.list .cities').addClass('hidden');
                            }
                        }
                        
                    })
        
                    $('main .pageHead .content form .form-group ul li').click(function(){
                        var dataId = $(this).attr('data-id');
                        $('main .pageHead .content form .form-group .focus').attr('data-id',dataId);
                        $(this).parents('ul').siblings('input').val($(this).text());
                        $(this).parents('ul').removeClass('show');
                        $(this).removeClass('focus');
                    })
                    $('main .pageHead .content .list .item span').click(function(){
                        var val = $(this).text();
                        $('main .pageHead .content form .form-group .focus').val(val);
                        $('main .pageHead .content .list').removeClass('show');
                        $('main .pageHead .content form .form-group input').removeClass('focus');
                    })
                    var provinces = [];
                    $.ajax({
                        type: "GET",
                        url: realm + "/api/getProvinces",
                        data: {},
                        dataType: "json",
                        contentType: 'application/json',
                        success: function(data){
                            provinces = data.data;
                            for(var p = 0;p < provinces.length;p++){
                                var html = "<p data-proid='" + provinces[p].id + "'>" + provinces[p].name + "</p>";
                                $('.area.list .provinces').append(html);
                            }
                            $('.area.list .provinces p').click(function(){
                                var proId = $(this).attr('data-proid');
                                var obj = {id:proId};
                                $.ajax({
                                    type: "POST",
                                    url: realm + "/api/getCityList",
                                    data: JSON.stringify(obj),
                                    dataType: "json",
                                    contentType: 'application/json',
                                    success: function(data){
                                        $('.area.list .cities').empty();
                                        $('.area.list .provinces').addClass('hidden');
                                        var cities = data.data;
                                        for(var c = 0;c < cities.length;c++){
                                            var city = cities[c].name;
                                            var cityId = cities[c].id;
                                            var inner = "<span data-id='" + cityId + "'>" + city + "</span>";
                                            $('.area.list .cities').append(inner);
                                        }
                                        $('.area.list .cities').removeClass('hidden');
                                        $('.area.list .cities span').click(function(){
                                            $('#area').attr('data-proid',proId);
                                            var val = $(this).text();
                                            var dataId = $(this).attr('data-id');
                                            $('main .pageHead .content form .form-group .focus').val(val);
                                            $('main .pageHead .content form .form-group .focus').attr('data-id',dataId);
                                            $(this).parent().addClass('hidden');
                                            $('.area.list .provinces').removeClass('hidden');
                                            $(this).parents('.list').removeClass('show');
                                        })
                                    },
                                    error:function(data){
                                        console.log(data);
                                    }
                                });
                            })
                        },
                        error:function(data){
                            console.log(data);
                        }
                    });
                    var trade = [];
                    $.ajax({
                        type: "GET",
                        url: realm + "/api/getTradeList",
                        data: {},
                        dataType: "json",
                        contentType: 'application/json',
                        success: function(data){
                            trade = data.data;
                            for(var t = 0;t < trade.length;t++){
                                var html = "<div class='item flex'><p class='typeName'>" + trade[t].name + "</p><p class='from flex'>";
                                for(var n = 0;n < trade[t].tradeList.length;n++){
                                    var inner = "<span data-id='" + trade[t].tradeList[n].id + "'>" + trade[t].tradeList[n].name + "</span>";
                                    html += inner;
                                }
                                html += "</p></div>";
                                $('.trade.list').append(html);
                            }
                            $('.trade.list .from span').click(function(){
                                var val = $(this).text();
                                var dataId = $(this).attr('data-id');
                                $('main .pageHead .content form .form-group .focus').val(val);
                                $('main .pageHead .content form .form-group .focus').attr('data-id',dataId);
                                $(this).parents('.list').removeClass('show');
                            })
                        },
                        error:function(data){
                            console.log(data);
                        }
                    });
                    /*$('a').click(function(e){
                        
                            linkHref = $(this).attr('href');
                            e = e || window.event;
                            e.cancelBubble = true;
                            e.stopPropagation();
                            if(e.preventDefault){ // w3c
                                e.preventDefault();
                            } else { // ie
                                e.returnValue = false;
                            }
                            countDown();
                            $('.leaving').addClass('jump');
                            $('.container').addClass('jump');
                    })*/
                    
            })

            

        